﻿function SaveCaseContract(CaseContractId) {
    ContractDate = document.getElementById("divContractDate").value;
    SignBy = document.getElementById("divSignBy").value;
    ContractTypeIndex = document.getElementById("divSelectContractType").selectedIndex;
    ContractType = document.getElementById("divSelectContractType").options[ContractTypeIndex].value;

    SendTypeIndex = document.getElementById("divSelectSendType").selectedIndex;
    SendType = document.getElementById("divSelectSendType").options[SendTypeIndex].value;

    RetValue = Portal.Vision.UpdateCaseContract.ServerSideSaveCaseContract(CaseContractId, ContractDate, ContractType, SendType, SignBy).value;

    if (RetValue.indexOf("ERROR") != -1) {
        alert(RetValue);
        return;
    }
    alert("Sửa chữa hợp đồng thành công!");
    window.open(RetValue, "_self");
}	